<%--
  Created by IntelliJ IDEA.
  User: Think
  Date: 2024/7/23
  Time: 下午3:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>表单处理</title>
</head>
<body>
<%
    String name = new String((request.getParameter("name")==null?"":request.getParameter("name")).getBytes("ISO-8859-1"),"utf-8");
%>
<h1>使用GET方法读取数据</h1>
<ul>
    <li><p><b>站点名：</b>
        <%=name%>
    </p></li>
    <li><p><b>网址：</b>
        <%=request.getParameter("url")%>
    </p></li>
    <li><p><b>bilibili网址：</b>
        <%=request.getParameter("bilibili")%>
    </p></li>
    <li><p><b>acfun网址：</b>
        <%=request.getParameter("acfun")%>
    </p></li>
    <li><p><b>ticktalk网址：</b>
        <%=request.getParameter("ticktalk")%>
    </p></li>
    <li><p><b>other网址：</b>
        <%=request.getParameter("other")%>
    </p></li>
</ul>
<h1>使用GET方法实例</h1>
<form action="formhandler.jsp" method="get">
    站点名称：<input type="text" name="name">
    <br/>
    网址：<input type="text" name="url">
    <input type="submit" value="提交">
</form>

<h1>使用post方法实例</h1>
<form action="formhandler.jsp" method="post">
    站点名称：<input type="text" name="name">
    <br/>
    网址：<input type="text" name="url">
    <input type="submit" value="提交">
</form>

<h1>CheckBox</h1>

<form action="formhandler.jsp" method="post">
    <input type="checkbox" name="bilibili" >哔哩哔哩动画
    <input type="checkbox" name="acfun" >acfun
    <input type="checkbox" name="ticktalk" >抖音
    <input type="checkbox" name="other" >其他
    <input type="submit" value="选择网站">

</form>
</body>
</html>
